package main

import "fmt"

func main() {
	planets := [...]string{
		"Mercury",
		"Venus",
		"Earth",
		"Mars",
		"Jupiter",
		"Saturn",
		"Uranus",
		"Neptune",
	}

	terrestrial := planets[0:4]
	gasGiants := planets[4:6]
	iceGiants := planets[6:8]
	allPlanets := planets[:]
	fmt.Println(terrestrial, gasGiants, iceGiants, allPlanets)

	//切分数组的语法也可以用于切分字符串
	neptune := "Neptune"
	tune := neptune[3:]
	fmt.Println(tune)
	neptune = "Poseidon"
	fmt.Println(tune)
}
